package com.yby6.common.utils.upload;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.IOException;


/**
 * oss配置
 *
 * @author TeouBle
 * @date 2021/06/11
 */
@Component
@ConfigurationProperties(prefix = "oss")
public class OSSConfig {
	/**
	 * 端点
	 */
	private String endpoint = "oss-cn-beijing.aliyuncs.com";
	/**
	 * 访问密钥id
	 */
	private String accessKeyId = "LTAI4FyGKDNxEvEiy5iE4mqR";
	/**
	 * 访问密钥的秘密
	 */
	private String accessKeySecret = "mTS24aj7egiBvyJIB1TS72stPZujEo";
	/**
	 * bucket名称
	 */
	private String bucketName = "oss-yby";

	/**
	 * oss url
	 */
	private String ossUrl = "https://oss-yby.yangbuyi.top/";

	/**
	 * 图片的位置
	 */
	private String picLocation = "yangbuyi-rbac/";

	/**
	 * 得到oss url
	 *
	 * @return {@link String}
	 */
	public String getOssUrl() {
		return ossUrl;
	}

	/**
	 * 设置oss url
	 *
	 * @param ossUrl oss url
	 */
	public void setOssUrl(String ossUrl) {
		this.ossUrl = ossUrl;
	}

	/**
	 * 获得端点
	 *
	 * @return {@link String}
	 */
	public String getEndpoint() {
		return endpoint;
	}

	/**
	 * 设置端点
	 *
	 * @param endpoint 端点
	 */
	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}

	/**
	 * 获得关键的id
	 *
	 * @return {@link String}
	 */
	public String getAccessKeyId() {
		return accessKeyId;
	}

	/**
	 * 设置访问密钥id
	 *
	 * @param accessKeyId 访问密钥id
	 */
	public void setAccessKeyId(String accessKeyId) {
		this.accessKeyId = accessKeyId;
	}

	/**
	 * 获得关键的秘密
	 *
	 * @return {@link String}
	 */
	public String getAccessKeySecret() {
		return accessKeySecret;
	}

	/**
	 * 设置访问关键秘密
	 *
	 * @param accessKeySecret 访问密钥的秘密
	 */
	public void setAccessKeySecret(String accessKeySecret) {
		this.accessKeySecret = accessKeySecret;
	}

	/**
	 * 桶名字
	 *
	 * @return {@link String}
	 */
	public String getBucketName() {
		return bucketName;
	}

	/**
	 * 集水桶名称
	 *
	 * @param bucketName bucket名称
	 */
	public void setBucketName(String bucketName) {
		this.bucketName = bucketName;
	}

	/**
	 * 得到图片的位置
	 *
	 * @return {@link String}
	 */
	public String getPicLocation() {
		return picLocation;
	}

	/**
	 * 设置图片的位置
	 *
	 * @param picLocation 图片的位置
	 */
	public void setPicLocation(String picLocation) {
		this.picLocation = picLocation;
	}

	/**
	 * 字符串
	 *
	 * @return {@link String}
	 */
	@Override
	public String toString() {
		return "OSSConfig{" +
				"endpoint='" + endpoint + '\'' +
				", accessKeyId='" + accessKeyId + '\'' +
				", accessKeySecret='" + accessKeySecret + '\'' +
				", bucketName='" + bucketName + '\'' +
				", picLocation='" + picLocation + '\'' +
				'}';
	}
}